package main

import (
	"github.com/gin-gonic/gin"
)


func main() {


	var languages = make([]Language, 0)

	languages = append(languages, Language{"java1", "java.com", 10})
	languages = append(languages, Language{"java2", "java.com", 10})
	languages = append(languages, Language{"java3", "java.com", 10})
	languages = append(languages, Language{"java4", "java.com", 10})
	languages = append(languages, Language{"java5", "java.com", 10})
	languages = append(languages, Language{"java6", "java.com", 10})
	languages = append(languages, Language{"java7", "java.com", 10})
	languages = append(languages, Language{"java8", "java.com", 10})
	languages = append(languages, Language{"java9", "java.com", 10})
	languages = append(languages, Language{"java10", "java.com", 10})
	languages = append(languages, Language{"java11", "java.com", 10})
	languages = append(languages, Language{"java12", "java.com", 10})
	languages = append(languages, Language{"java13", "java.com", 10})
	languages = append(languages, Language{"java14", "java.com", 10})
	languages = append(languages, Language{"java15", "java.com", 10})


	r := gin.Default()
	r.GET("/paging", func(context *gin.Context) {
		context.JSON(200, Response{200, "请求成功", languages})
	})
	r.Run()
}

type Language struct {
	Name string `json:"name"`
	Mainpage string `json:"mainpage"`
	Activity int	`json:"activity"`
}


type Response struct{
	Code int
	Msg string
	Data interface{}
}